#ifndef OsgCapture_H
#define OsgCapture_H

#include <osg/Referenced>
#include <osg/Image>
#include <amk3/amk3.h>

class AMK_API OsgCaptureCallback : public osg::Referenced
{
public:
	virtual int handle(osg::Image* img) = 0;
};

class WindowCaptureCallback;
class AMK_API OsgCapture : public osg::Referenced
{
public:
	OsgCapture();
	virtual ~OsgCapture();

	int activate(int type = 0);

	int captureAndSaveImage(std::string path);

	int captureAndSaveDepthImage(std::string path);

	void start();
	void end();

	inline void setCaptureCallback(OsgCaptureCallback* cb) { _callback = cb; }
	inline OsgCaptureCallback* getCaptureCallback() { return  _callback.get(); }

protected:
	osg::ref_ptr< OsgCaptureCallback> _callback;
	osg::ref_ptr< WindowCaptureCallback> _win_cap_back;
};



#endif